function search()
{
	var temp = document.getElementById('choose_category');
	var category = temp.value;
	var temp = document.getElementById('choose_location');
	var location = temp.value;

	$.ajax({
		url : base_url + "alternatives/sort/"+category + "/" + location,
		type : 'post',
		dataType : 'json',
		success : function (response)
		{

			alternatives = response;
			curr_page = 1;
			per_page = 8;
			num_pages = Math.ceil(alternatives.length / per_page);
			if(num_pages == 0){
				num_pages = 1;
			}
			
			makePaginator();
			DisplayPage(curr_page);
			positionPaginator();
			$(".resize-200").load(function(){
				resize($(this), 200);
			});
			replaceIdByName();
			replaceIdByPic();
			
		}
	});
}